<html>
<head>
<title>getFirstMatch</title>
</head>
<script type="text/javascript" src="getFirstMatch.js"></script>
<script type="text/javascript">
<!--
alert(getFirstMatch(/a=(\d+)/, "&a=123&b=xx", 1)); 
//-->
</script>
<body>
</body>
</html>